<!doctype html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="Docusaurus v2.0.0-alpha.72">
<link rel="alternate" type="application/rss+xml" href="/zh-cn.neutralinojs.github.io/blog/rss.xml" title="Neutralinojs Blog RSS Feed">
<link rel="alternate" type="application/atom+xml" href="/zh-cn.neutralinojs.github.io/blog/atom.xml" title="Neutralinojs Blog Atom Feed">
<link rel="preconnect" href="https://www.google-analytics.com">
<link rel="preconnect" href="https://www.googletagmanager.com">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-120983955-1"></script>
<script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","UA-120983955-1",{anonymize_ip:!0})</script>
<script src="https://media.ethicalads.io/media/client/ethicalads.min.js"></script>
<script src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" async></script><title data-react-helmet="true">框架 | Neutralinojs</title><meta data-react-helmet="true" property="og:url" content="https://wll8.gitee.io/zh-cn.neutralinojs.github.io/zh-cn.neutralinojs.github.io/docs/release-notes/framework"><meta data-react-helmet="true" name="docusaurus_locale" content="en"><meta data-react-helmet="true" name="docusaurus_version" content="current"><meta data-react-helmet="true" name="docusaurus_tag" content="docs-default-current"><meta data-react-helmet="true" property="og:title" content="框架 | Neutralinojs"><meta data-react-helmet="true" name="description" content="Unreleased"><meta data-react-helmet="true" property="og:description" content="Unreleased"><link data-react-helmet="true" rel="shortcut icon" href="/zh-cn.neutralinojs.github.io/img/favicon.png"><link data-react-helmet="true" rel="canonical" href="https://wll8.gitee.io/zh-cn.neutralinojs.github.io/zh-cn.neutralinojs.github.io/docs/release-notes/framework"><link data-react-helmet="true" rel="alternate" href="https://wll8.gitee.io/zh-cn.neutralinojs.github.io/zh-cn.neutralinojs.github.io/docs/release-notes/framework" hreflang="en"><link data-react-helmet="true" rel="alternate" href="https://wll8.gitee.io/zh-cn.neutralinojs.github.io/zh-cn.neutralinojs.github.io/docs/release-notes/framework" hreflang="x-default"><link rel="stylesheet" href="/zh-cn.neutralinojs.github.io/assets/css/styles.b7ecac1c.css">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/styles.c25d7c9f.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/runtime~main.da1bdab8.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/main.22927eab.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/1.a80d899d.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/2.818fc9a7.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/49.8e895b96.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/50.816652b0.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/935f2afb.a67ede05.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/17896441.74f92a0c.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/0f9c640a.de22ead4.js" as="script">
</head>
<body>
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script><div id="__docusaurus">
<div><a href="#main" class="skipToContent_1oUP">Skip to main content</a></div><nav class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Navigation bar toggle" class="navbar__toggle" type="button" tabindex="0"><svg aria-label="Menu" width="30" height="30" viewBox="0 0 30 30" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/zh-cn.neutralinojs.github.io/"><img src="/zh-cn.neutralinojs.github.io/img/logo.png" alt="Neutralinojs Logo" class="themedImage_1VuW themedImage--light_3UqQ navbar__logo"><img src="/zh-cn.neutralinojs.github.io/img/logo.png" alt="Neutralinojs Logo" class="themedImage_1VuW themedImage--dark_hz6m navbar__logo"><strong class="navbar__title">Neutralinojs</strong></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/zh-cn.neutralinojs.github.io/docs/">文档</a><a class="navbar__item navbar__link" href="/zh-cn.neutralinojs.github.io/apps/">应用</a><a class="navbar__item navbar__link" href="/zh-cn.neutralinojs.github.io/resources/">资源</a><a href="https://www.youtube.com/c/CodeZri" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">视频</a><a href="https://codezri.org/blog/neutralinojs-2024-roadmap" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">路线图</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/zh-cn.neutralinojs.github.io/docs/release-notes/framework">发布说明</a><a href="https://github.com/neutralinojs/gsoc2024" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GSoC 2024</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/neutralinojs" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GitHub</a><a href="https://www.patreon.com/shalithasuranga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">❤️ 捐赠</a><div class="react-toggle react-toggle--disabled displayOnlyInLargeViewport_GrZ2"><div class="react-toggle-track"><div class="react-toggle-track-check"><span class="toggle_71bT">🌜</span></div><div class="react-toggle-track-x"><span class="toggle_71bT">🌞</span></div></div><div class="react-toggle-thumb"></div><input type="checkbox" disabled="" aria-label="Dark mode toggle" class="react-toggle-screenreader-only"></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div><div class="navbar-sidebar"><div class="navbar-sidebar__brand"><a class="navbar__brand" href="/zh-cn.neutralinojs.github.io/"><img src="/zh-cn.neutralinojs.github.io/img/logo.png" alt="Neutralinojs Logo" class="themedImage_1VuW themedImage--light_3UqQ navbar__logo"><img src="/zh-cn.neutralinojs.github.io/img/logo.png" alt="Neutralinojs Logo" class="themedImage_1VuW themedImage--dark_hz6m navbar__logo"><strong class="navbar__title">Neutralinojs</strong></a></div><div class="navbar-sidebar__items"><div class="menu"><ul class="menu__list"><li class="menu__list-item"><a aria-current="page" class="menu__link navbar__link--active" href="/zh-cn.neutralinojs.github.io/docs/">文档</a></li><li class="menu__list-item"><a class="menu__link" href="/zh-cn.neutralinojs.github.io/apps/">应用</a></li><li class="menu__list-item"><a class="menu__link" href="/zh-cn.neutralinojs.github.io/resources/">资源</a></li><li class="menu__list-item"><a href="https://www.youtube.com/c/CodeZri" target="_blank" rel="noopener noreferrer" class="menu__link">视频</a></li><li class="menu__list-item"><a href="https://codezri.org/blog/neutralinojs-2024-roadmap" target="_blank" rel="noopener noreferrer" class="menu__link">路线图</a></li><li class="menu__list-item"><a aria-current="page" class="menu__link navbar__link--active" href="/zh-cn.neutralinojs.github.io/docs/release-notes/framework">发布说明</a></li><li class="menu__list-item"><a href="https://github.com/neutralinojs/gsoc2024" target="_blank" rel="noopener noreferrer" class="menu__link">GSoC 2024</a></li><li class="menu__list-item"><a href="https://github.com/neutralinojs" target="_blank" rel="noopener noreferrer" class="menu__link">GitHub</a></li><li class="menu__list-item"><a href="https://www.patreon.com/shalithasuranga" target="_blank" rel="noopener noreferrer" class="menu__link">❤️ 捐赠</a></li></ul></div></div></div></nav><div class="main-wrapper main-docs-wrapper"><div class="docPage_31aa"><div class="docSidebarContainer_3Kbt" role="complementary"><div class="sidebar_15mo"><div class="menu menu--responsive thin-scrollbar menu_Bmed"><button aria-label="Open menu" aria-haspopup="true" class="button button--secondary button--sm menu__button" type="button"><svg aria-label="Menu" class="sidebarMenuIcon_fgN0" width="24" height="24" viewBox="0 0 30 30" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><ul class="menu__list"><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">入门指南</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/">简介</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/getting-started/your-first-neutralinojs-app">您的第一个Neutralinojs应用</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/getting-started/using-frontend-libraries">使用前端库</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">原生 API</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/overview">原生API概览</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/app">Neutralino.app</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/clipboard">Neutralino.clipboard</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/computer">Neutralino.computer</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/custom">Neutralino.custom</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/debug">Neutralino.debug</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/events">Neutralino.events</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/extensions">Neutralino.extensions</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/filesystem">Neutralino.filesystem</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/init">Neutralino.init</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/os">Neutralino.os</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/storage">Neutralino.storage</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/updater">Neutralino.updater</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/window">Neutralino.window</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/error-codes">错误码</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/global-variables">全局变量</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">CLI</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/cli/neu-cli">neu CLI</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/cli/internal-cli-arguments">Internal 命令行参数</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">配置</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/configuration/neutralino.config.json">neutralino.config.json</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/configuration/project-structure">项目结构</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/configuration/modes">模式</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">如何操作</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/how-to/extensions-overview">扩展概述</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/how-to/auto-updater">自动更新器</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">分发</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/distribution/overview">分发概述</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">贡献</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/framework-developer-guide">框架开发指南</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/architecture">架构</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/security">安全性</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/code-style-guide">代码风格指南</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/developer-support">开发者支持</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/committers">提交者</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/frequently-asked-questions">常见问题解答</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/about-neutralinojs">关于 Neutralinojs</a></li></ul></li><li class="menu__list-item"><a class="menu__link menu__link--sublist menu__link--active" href="#!">发布说明</a><ul class="menu__list"><li class="menu__list-item"><a aria-current="page" class="menu__link menu__link--active active" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/release-notes/framework">框架</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/release-notes/cli">命令行</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/release-notes/client-library">客户端</a></li></ul></li></ul></div></div></div><main class="docMainContainer_3ufF"><div class="container padding-vert--lg docItemWrapper_3FMP"><div class="row"><div class="col docItemCol_2rXS"><div class="docItemContainer_1EXp"><article><header><h1 class="docTitle_1vX4">框架</h1></header><div class="markdown"><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="unreleased"></a>Unreleased<a class="hash-link" href="#unreleased" title="Direct link to heading">#</a></h2><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="v500"></a>v5.0.0<a class="hash-link" href="#v500" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-reading-writing-with-standard-streams"></a>API: Reading, writing with standard streams<a class="hash-link" href="#api-reading-writing-with-standard-streams" title="Direct link to heading">#</a></h3><ul><li>实现<code>app.readProcessInput(readAll=false)</code>，用于从标准输入流读取字符串数据。此函数可以一次读取单行或多行。</li><li>实现<code>app.writeProcessOutput</code>和<code>app.writeProcessError</code>，分别将字符串数据发送到标准输出和错误流。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-filesystem"></a>API: filesystem<a class="hash-link" href="#api-filesystem" title="Direct link to heading">#</a></h3><ul><li>在<code>filesystem.createDirectory</code>函数中启用默认的递归行为。</li><li>添加<code>filesystem.copy</code>、<code>filesystem.move</code>和<code>filesystem.remove</code>函数。</li><li>在<code>filesystem.readDirectory(path, options)</code>中添加<code>{recursive}</code>选项对象，激活递归目录列表。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-os"></a>API: os<a class="hash-link" href="#api-os" title="Direct link to heading">#</a></h3><ul><li>接受<code>os.execCommand</code>函数背景模式的标准输入。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="core-security"></a>Core: security<a class="hash-link" href="#core-security" title="Direct link to heading">#</a></h3><ul><li>现在，所有应用客户端和扩展都需要有效的连接令牌（<code>NL_TOKEN</code>的一部分）才能连接到Neutralinojs框架WebSocket服务器以接收应用事件。</li><li>框架现在通过标准输入将访问令牌、连接令牌、端口和扩展标识符发送到扩展进程，因此其他进程无法通过扫描进程列表来读取它们。</li><li>在HTTP/WS握手期间检查WebSocket客户端连接源，以确保只有本地客户端可以连接到在窗口、浏览器或Chrome模式下运行的特定Neutralinojs应用。云模式允许任何URL来源。</li><li>上述安全增强修复了GitHub上的两个安全顾问。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="global-variables"></a>Global variables<a class="hash-link" href="#global-variables" title="Direct link to heading">#</a></h3><ul><li>现在<code>NL_ARCH</code>全局变量返回与<code>computer.getArch</code>返回的相同值。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="deprecations"></a>Deprecations<a class="hash-link" href="#deprecations" title="Direct link to heading">#</a></h3><ul><li>移除<code>filesystem.removeFile</code>、<code>filesystem.removeDirectory</code>、<code>filesystem.copyFile</code>和<code>filesystem.moveFile</code>函数。</li><li>扩展不会再以命令行参数的形式接收<code>--nl-port</code>、<code>--nl-token</code>和<code>--nl-extension-id</code>。现在框架通过stdin作为JSON字符串发送这些。</li></ul><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="v4150"></a>v4.15.0<a class="hash-link" href="#v4150" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="configuration-custom-user-agent-string"></a>Configuration: custom user agent string<a class="hash-link" href="#configuration-custom-user-agent-string" title="Direct link to heading">#</a></h3><p>开发者有时使用用户代理字符串在服务端和客户端源代码中识别客户端。现在，Neutralinojs允许应用开发者通过<code>window.extendUserAgentWith</code>配置属性和<code>--window-extend-user-agent-with=&lt;string&gt;</code>命令行选项，扩展默认的用户代理字符串，如下例所示：</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly js"><div tabindex="0" class="prism-code language-js codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token string" style="color:rgb(195, 232, 141)">&quot;window&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">  </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// ---</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">  </span><span class="token string" style="color:rgb(195, 232, 141)">&quot;extendUserAgentWith&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&quot;MyAppClient&quot;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><p>上述配置扩展了用户代理字符串：</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly js"><div tabindex="0" class="prism-code language-js codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token console class-name" style="color:rgb(255, 203, 107)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token dom variable" style="color:rgb(191, 199, 213)">navigator</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">userAgent</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain">    </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// &lt;Default UA&gt; MyAppClient </span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="configuration-custom-configuration-files"></a>Configuration: custom configuration files<a class="hash-link" href="#configuration-custom-configuration-files" title="Direct link to heading">#</a></h3><p>Neutralinojs框架通常从<code>neutralino.config.json</code>文件加载应用配置内容，但有时应用开发者需要在开发过程中使用自定义的配置文件名（例如，为了分离生产和开发环境）。现在，你可以使用<code>--config-file=&lt;filename&gt;</code>内部命令行参数使用自定义应用配置，如下例所示：</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly bash"><div tabindex="0" class="prism-code language-bash codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">./myapp-linux_x64 --load-dir-res --config-file</span><span class="token operator" style="color:rgb(137, 221, 255)">=</span><span class="token plain">neutralino-dev.config.json</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="v4141"></a>v4.14.1<a class="hash-link" href="#v4141" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="devops"></a>DevOps<a class="hash-link" href="#devops" title="Direct link to heading">#</a></h3><ul><li>使用Windows 2019服务器和macOS 11（Big Sur）来编译框架发布工件。</li><li>通过<code>MACOSX_DEPLOYMENT_TARGET=10.7</code>设置支持的最小macOS版本。</li></ul><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="v4140"></a>v4.14.0<a class="hash-link" href="#v4140" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="filesystem-api"></a>Filesystem API<a class="hash-link" href="#filesystem-api" title="Direct link to heading">#</a></h3><ul><li>引入<code>filesystem.getWatchers</code>函数来获取所有创建的监视器。</li><li>为<code>filesystem.updateOpenedFile(id, action, data)</code>函数添加二进制文件读取支持。此函数在<code>openedFile</code>全局事件中实现了<code>readBinary</code>和<code>readAllBinary</code>动作以及<code>dataBinary</code>输出动作。</li><li>如果给定路径已有现有活动监视器，则<code>filesystem.createWatcher</code>返回现有监视器标识符。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="os-api"></a>OS API<a class="hash-link" href="#os-api" title="Direct link to heading">#</a></h3><ul><li>为进程创建函数添加设置当前工作目录的方法：<code>os.execCommand(command, options)</code>现在通过选项对象支持<code>cwd</code>，<code>os.spawnProcess(command, cwd)</code>通过第二个字符串参数接受当前工作目录。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="improvementsbugfixes"></a>Improvements/bugfixes<a class="hash-link" href="#improvementsbugfixes" title="Direct link to heading">#</a></h3><ul><li>修复Windows上托盘菜单中的Unicode字符问题。</li><li>避免将空字节包含到由<code>filesystem.openFile</code>函数发起的文件阅读器事件中。</li><li>在非窗口模式下放弃<code>window</code>方法执行。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="devops-1"></a>DevOps<a class="hash-link" href="#devops-1" title="Direct link to heading">#</a></h3><ul><li>将外部GitHub Action包更新到最新版本。</li><li>修复测试用例失败的问题。</li></ul><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="v4130"></a>v4.13.0<a class="hash-link" href="#v4130" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="core-persistent-window-state"></a>Core: persistent window state<a class="hash-link" href="#core-persistent-window-state" title="Direct link to heading">#</a></h3><p>现在框架将主窗口状态存储在临时文件中（JSON格式），并在启动过程中加载。
此功能存储并设置窗口位置（x，y坐标）、大小（宽度和高度）以及最大化状态。此功能在所有平台上默认启用，但应用开发者可以通过使用<code>window.useSavedState</code>配置属性的<code>false</code>或<code>--window-use-saved-state</code>内部CLI参数将其关闭。</p><p>此外，通过<code>NL_WSAVSTLOADED</code>全局变量可以获得窗口状态加载状态。如果窗口状态已从保存的配置中加载，则框架将此布尔变量设置为<code>true</code>。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="improvementsbugfixes-1"></a>Improvements/bugfixes<a class="hash-link" href="#improvementsbugfixes-1" title="Direct link to heading">#</a></h3><ul><li>修复了Windows上的webview代码中的几个问题（例如，等待窗口关闭事件，窗口样式修复等）。</li></ul><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="v4120"></a>v4.12.0<a class="hash-link" href="#v4120" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-window"></a>API: window<a class="hash-link" href="#api-window" title="Direct link to heading">#</a></h3><ul><li>添加<code>window.center</code>来以编程方式居中应用窗口。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="core-configuration"></a>Core: configuration<a class="hash-link" href="#core-configuration" title="Direct link to heading">#</a></h3><ul><li>通过<code>modes.window.x</code>和<code>modes.window.y</code>整数配置属性设置初始窗口位置。</li><li>通过<code>modes.window.center</code>布尔配置属性在启动时居中窗口。</li><li>添加启动窗口位置的配置覆盖：<code>--window-center=&lt;true|false&gt;</code>、<code>--window-x=&lt;int&gt;</code>和<code>--window-y=&lt;int&gt;</code></li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="core-webview"></a>Core: webview<a class="hash-link" href="#core-webview" title="Direct link to heading">#</a></h3><ul><li>在Windows上静态链接Webview2加载库，因此应用开发者可以在不包含<code>WebView2Loader.dll</code>文件的情况下打包他们的应用。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="improvementsbugfixes-2"></a>Improvements/bugfixes<a class="hash-link" href="#improvementsbugfixes-2" title="Direct link to heading">#</a></h3><ul><li>为Neutralinojs Windows添加了对Unicode字符的支持。</li></ul><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="v4110"></a>v4.11.0<a class="hash-link" href="#v4110" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-file-watchers"></a>API: File watchers<a class="hash-link" href="#api-file-watchers" title="Direct link to heading">#</a></h3><p>在某些情况下，Neutralinojs应用开发者需要在他们的应用中实现文件监视器。之前，Neutralinojs API没有提供原生文件监视器API，开发者不得不使用性能较差的替代方法，例如递归调用<code>filesystem.readDirectory</code>。新的文件监视器API允许你为文件系统路径创建原生的、跨平台的、基于事件的文件监视器，具有以下功能：</p><ul><li><code>filesystem.createWatcher(path)</code>：为给定路径创建一个新的文件监视器，并返回监视器标识符。</li><li><code>filesystem.removeWatcher(watcherId)</code>：基于文件监视器标识符移除文件监视器。</li></ul><p>每当文件系统发生变化时，文件监视器实例会分发带有以下数据的<code>watchFile</code>事件：</p><ul><li><code>id</code>：监视器标识符</li><li><code>action</code>：文件系统变化：<code>add</code>、<code>delete</code>、<code>modified</code>和<code>moved</code></li><li><code>dir</code>：目录路径</li><li><code>filename</code>：修改的文件</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="improvementsbugfixes-3"></a>Improvements/bugfixes<a class="hash-link" href="#improvementsbugfixes-3" title="Direct link to heading">#</a></h3><ul><li>修复Windows上初始窗口闪烁和隐藏窗口状态问题。</li><li>修复二进制文件追加中的数据损坏。</li><li>根据系统偏好设置在Windows上应用深色/浅色主题。</li></ul><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="v4100"></a>v4.10.0<a class="hash-link" href="#v4100" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="devops-2"></a>DevOps<a class="hash-link" href="#devops-2" title="Direct link to heading">#</a></h3><ul><li>使用GitHub工作流程生成官方的macOS <code>arm64</code>（用于Apple M1及更高设备）和通用二进制文件。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="improvementsbugfixes-4"></a>Improvements/bugfixes<a class="hash-link" href="#improvementsbugfixes-4" title="Direct link to heading">#</a></h3><ul><li>为<code>neutralino.config.json</code>文件添加<a href="https://json-schema.org/" target="_blank" rel="noopener noreferrer">JSON模式</a>定义。</li><li>修复在macOS <code>arm64</code>系统上的源代码编译问题。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="esmnpm-support"></a>ESM/NPM support<a class="hash-link" href="#esmnpm-support" title="Direct link to heading">#</a></h3><p>Neutralinojs通常在单独的文件（<code>neutralino.js</code>）中存储客户端库实现。这种方法通过全局暴露的JavaScript对象<code>Neutralino</code>使Neutralinojs应用开发过程更加简单。但是，现代Web开发者使用ES模块，他们通常喜欢从NPM获取依赖项。所以，现在，开发者可以通过加载<code>__neutralino_globals.js</code>内部脚本（例如，<code>&lt;script src=&quot;__neutralino_globals.js&quot;&gt;&lt;/script&gt;</code>）来仅加载全局变量。然后，他们可以通过neu CLI使用<code>neutralino.mjs</code>客户端库实现，或者通过Node包管理器从<a href="https://www.npmjs.com/package/@neutralinojs/lib" target="_blank" rel="noopener noreferrer"><code>@neutralinojs/lib</code></a>使用。</p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="v490"></a>v4.9.0<a class="hash-link" href="#v490" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-custom-methods"></a>API: Custom methods<a class="hash-link" href="#api-custom-methods" title="Direct link to heading">#</a></h3><p>Neutralinojs提供了扩展API来用任何编程语言编写自定义后端代码，但扩展在某些场景下会带来以下缺点，影响应用：</p><ul><li>扩展使用共享WebSocket进行通信，因此在扩展中使用直接的C++引用（例如，窗口处理器）是不可能的。</li><li>开发者负责打包他们的扩展二进制文件。</li><li>基于C++的扩展由于基于WebSockets的IPC，其速度不如原生C++代码快。</li></ul><p>另一种选择是，开发者可以下载框架C++代码，修改并重新编译。但是，开发者可能在同步上游代码修改时遇到问题。因此，Neutralinojs提供了单独的命名空间、函数模板、内置辅助函数（例如，获取窗口处理器、验证等）和开发指南，以在不更新框架核心的情况下向Neutralinojs框架添加自定义API。</p><p>示例：</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly js"><div tabindex="0" class="prism-code language-js codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token keyword" style="font-style:italic">let</span><span class="token plain"> res </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">custom</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">fetch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;https://neutralino.js.org&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><p>如果开发者制作了其他人可以使用的自定义API，我们鼓励他们通过将其添加到主代码库中，为Neutralinojs框架做出贡献。</p><p>示例：</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly js"><div tabindex="0" class="prism-code language-js codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token keyword" style="font-style:italic">let</span><span class="token plain"> res </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">net</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">fetch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;https://neutralino.js.org&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><p>如果开发者向框架添加了新的自定义方法，客户端库将自动通过使用<code>NL_CMETHODS</code>内部全局变量将其导出到<code>Neutralino.custom</code>命名空间。<code>Neutralino.custom.getMethods</code>函数返回与<code>NL_CMETHODS</code>类似的自定义方法数组。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-file-streams"></a>API: File streams<a class="hash-link" href="#api-file-streams" title="Direct link to heading">#</a></h3><p>当前Neutralinojs API提供了非流式基础（基于Promise但类似同步的）函数来处理文件。例如，<code>filesystem.readFile</code>函数读取文件内容并同步检索数据，尽管WebSocket通信机制支持异步模式。然而，同步API让开发者以简单的方式处理文件，但在某些情况下他们会遇到以下问题：</p><ul><li>读取大文件对性能不友好（整个文件内容被加载到内存中）。</li><li>无法处理动态文件对象（例如，设备文件）。</li><li>文件描述符在应用生命周期内不是持久的，因为它们在原生API调用后被销毁。</li></ul><p>为了解决这个问题，我们提供了一个基于事件的文件流API，具有以下函数/事件：</p><h4><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="functions"></a>Functions<a class="hash-link" href="#functions" title="Direct link to heading">#</a></h4><ul><li><code>filesystem.openFile</code>：通过打开文件创建文件流。</li><li><code>filesystem.updateOpenedFile</code>：触发文件<code>read</code>/<code>readAll</code>事件或设置文件光标。</li><li><code>filesystem.getOpenedFileInfo</code>：返回（等待的）有关文件流的信息（属性：<code>id</code>、<code>eof</code>、<code>pos</code>和<code>lastRead</code>）</li></ul><h4><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="events"></a>Events<a class="hash-link" href="#events" title="Direct link to heading">#</a></h4><ul><li><code>openedFile</code>：每次文件读取事件发生时以及文件流达到<code>EOF</code>时触发。</li></ul><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="v480"></a>v4.8.0<a class="hash-link" href="#v480" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-osgetenvs"></a>API: os.getEnvs<a class="hash-link" href="#api-osgetenvs" title="Direct link to heading">#</a></h3><p><code>os.getEnv</code>返回给定环境变量键的值。开发者不得不使用替代方法来检索所有环境变量及其值的列表。<code>os.getEnvs</code>以与Node的<a href="https://nodejs.dev/en/api/v18/process/#processenv" target="_blank" rel="noopener noreferrer"><code>process.env</code></a>类似的JavaScript对象形式返回所有环境变量。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-filesystem-1"></a>API: filesystem<a class="hash-link" href="#api-filesystem-1" title="Direct link to heading">#</a></h3><ul><li>为<code>readFile</code>和<code>readBinaryFile</code>方法添加了<code>pos</code>和<code>size</code>选项，分别设置文件光标位置和缓冲区大小。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-storagegetkeys"></a>API: storage.getKeys<a class="hash-link" href="#api-storagegetkeys" title="Direct link to heading">#</a></h3><p>添加<code>storage.getKeys</code>函数以获取Neutralinojs存储键的数组。现在，开发者不需要使用文件系统API编写自己的函数来检索存储键。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-computergetmouseposition"></a>API: computer.getMousePosition<a class="hash-link" href="#api-computergetmouseposition" title="Direct link to heading">#</a></h3><p>通过具有<code>x</code>和<code>y</code>属性的JavaScript对象返回当前鼠标光标位置。此函数对于在所有支持的平台上开发交互式桌面小部件很有帮助。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="bugfixesimprovements"></a>Bugfixes/improvements<a class="hash-link" href="#bugfixesimprovements" title="Direct link to heading">#</a></h3><ul><li>在C++源代码中用枚举替换字符串错误代码。</li><li>在C++结构定义和返回值中进行了一些重构。</li></ul><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="v470"></a>v4.7.0<a class="hash-link" href="#v470" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-system-information-api"></a>API: System information API<a class="hash-link" href="#api-system-information-api" title="Direct link to heading">#</a></h3><p>之前，我们在<code>computer</code>命名空间中有<code>getMemoryInfo</code>函数来检索系统内存统计信息。现在，我们添加了更多函数来获取有关CPU、操作系统、内核和连接显示器的详细信息：</p><ul><li><code>computer.getArch</code>：返回CPU架构。例如，<code>x64</code>、<code>arm</code>等。</li><li><code>computer.getKernelInfo</code>：返回操作系统内核的详细信息。</li><li><code>computer.getOSInfo</code>：返回操作系统的详细信息。</li><li><code>computer.getCPUInfo</code>：返回CPU的详细信息。</li><li><code>computer.getDisplays</code>：返回一个包含分辨率、频率等信息的所有连接显示器的数组。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-os-dialogs"></a>API: os dialogs<a class="hash-link" href="#api-os-dialogs" title="Direct link to heading">#</a></h3><ul><li>为<code>showSaveDialog</code>、<code>showOpenDialog</code>和<code>showFolderDialog</code>函数添加<code>defaultPath</code>选项，以设置系统对话框的初始路径/文件名。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="devops-3"></a>DevOps<a class="hash-link" href="#devops-3" title="Direct link to heading">#</a></h3><ul><li>在Windows GitHub Actions实例上运行测试套件。</li><li>修复GitHub Actions工作流中<code>armhf</code>框架二进制文件生成的问题。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="bugfixesimprovements-1"></a>Bugfixes/improvements<a class="hash-link" href="#bugfixesimprovements-1" title="Direct link to heading">#</a></h3><ul><li>默认情况下从Chrome模式中隐藏自动化信息栏——如果开发者需要特定的命令行开关，他们可以在配置文件中添加<code>--enable-automation</code>标志。</li></ul><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="v460"></a>v4.6.0<a class="hash-link" href="#v460" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-process-spawning-api"></a>API: Process spawning API<a class="hash-link" href="#api-process-spawning-api" title="Direct link to heading">#</a></h3><p>我们有<code>os.execCommand</code>用于启动进程，但它是同步的，意味着开发者必须等到进程完成后才能接收<code>pid</code>、<code>stdOut</code>和<code>stdErr</code>。<code>execCommand</code>不适用于长时间运行的进程。新的生成API提供了API函数，用于以多线程方式处理长时间运行的进程。</p><ul><li><code>os.spawnProcess(command)</code>：生成一个进程并返回<code>id</code>（一个虚拟的Neutralino作用域pid）和<code>pid</code>（操作系统级别的pid）。</li><li><code>os.getSpawnedProcesses()</code>：返回生成的进程列表。</li><li><code>os.updateSpawnedProcess(id, action, data)</code>：为生成的进程发送一个动作事件。支持以下动作：<ul><li><code>stdIn</code>：通过标准输入流发送字符串。<code>data</code>是输入字符串。</li><li><code>stdInEnd</code>：关闭标准输入流。</li><li><code>exit</code>：终止生成的进程。</li></ul></li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="core-events"></a>Core: events<a class="hash-link" href="#core-events" title="Direct link to heading">#</a></h3><ul><li><code>spawnedProcess</code>：当生成的进程发生变化时分发。<code>CustomEvent</code>会触发带有以下对象的事件：</li></ul><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly js"><div tabindex="0" class="prism-code language-js codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">  id</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token plain">id</span><span class="token operator" style="color:rgb(137, 221, 255)">&gt;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">  pid</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token plain">pid</span><span class="token operator" style="color:rgb(137, 221, 255)">&gt;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">  action</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token plain">action</span><span class="token operator" style="color:rgb(137, 221, 255)">&gt;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">  data</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token plain">data</span><span class="token operator" style="color:rgb(137, 221, 255)">&gt;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><p>可用的动作：</p><ul><li><code>stdOut</code>：输出标准输出数据。<code>data</code>包含标准输出负载。</li><li><code>stdErr</code>：输出标准错误数据。<code>data</code>包含标准错误负载。</li><li><code>exit</code>：当进程终止时通知。<code>data</code>包含进程退出代码。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="devops-4"></a>DevOps<a class="hash-link" href="#devops-4" title="Direct link to heading">#</a></h3><ul><li>为标准发布工作流程和夜间构建添加官方Linux ARM（armhf和arm64）二进制文件构建支持。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-filesystem-2"></a>API: filesystem<a class="hash-link" href="#api-filesystem-2" title="Direct link to heading">#</a></h3><ul><li>通过<code>filesystem.getStats</code>函数公开<code>createdAt</code>和<code>modifiedAt</code>的JavaScript时间戳。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="bugfixesimprovements-2"></a>Bugfixes/improvements<a class="hash-link" href="#bugfixesimprovements-2" title="Direct link to heading">#</a></h3><ul><li>在Windows上隐藏<code>.storage</code>目录（Neutralinojs存储位置）。</li><li>支持在资源URLs中使用查询参数。例如，支持<code>index.html?v=2.0</code>，但尚未实现缓存。</li><li>为Neutralinojs服务器初始化失败显示用户友好的错误消息。</li></ul><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="v450"></a>v4.5.0<a class="hash-link" href="#v450" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="core-events-1"></a>Core: events<a class="hash-link" href="#core-events-1" title="Direct link to heading">#</a></h3><ul><li>添加了<code>windowFocus</code>和<code>windowBlur</code>原生事件。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="devops-5"></a>DevOps<a class="hash-link" href="#devops-5" title="Direct link to heading">#</a></h3><ul><li>使用<a href="https://github.com/codezri/buildzri" target="_blank" rel="noopener noreferrer">BuildZri</a>进行C++构建自动化。</li><li>实现夜间发布的新工作流程。开发者可以通过<code>nightly</code>版本标签获取夜间发布的二进制文件。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="bugfixesimprovements-3"></a>Bugfixes/improvements<a class="hash-link" href="#bugfixesimprovements-3" title="Direct link to heading">#</a></h3><ul><li>在Linux上搜索并动态加载应用指示器库。此增强支持Neutralinojs在系统上没有应用指示器库时不崩溃启动。</li><li>对<code>os.setTray</code>函数的初始化失败抛出<code>NE_OS_TRAYIER</code>错误。</li><li>修复了Windows上<code>filesystem.writeBinaryFile</code>函数的二进制文件写入错误。这通过在所有平台上使用<code>LF</code>作为行分隔符作为便携式解决方案得到修复。如果开发者在Windows（或Darwin）上需要CRLF，开发者需要使用<code>NL_OS</code>明确处理。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="core-global-variables"></a>Core: global variables<a class="hash-link" href="#core-global-variables" title="Direct link to heading">#</a></h3><ul><li>添加<code>NL_COMMIT</code>以保存框架的发布提交。这有助于找到夜间发布的代码快照。</li></ul><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="v440"></a>v4.4.0<a class="hash-link" href="#v440" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-window-1"></a>API: window<a class="hash-link" href="#api-window-1" title="Direct link to heading">#</a></h3><ul><li>添加<code>window.getPosition</code>以获取当前窗口坐标。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-filesystem-3"></a>API: filesystem<a class="hash-link" href="#api-filesystem-3" title="Direct link to heading">#</a></h3><ul><li>添加<code>filesystem.appendFile</code>以将文本内容追加到文件。抛出的错误与<code>filesystem.writeFile</code>函数类似。</li><li>添加<code>filesystem.appendBinaryFile</code>以将二进制内容追加到文件。抛出的错误与<code>filesystem.writeBinaryFile</code>函数类似。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="dependencies"></a>Dependencies<a class="hash-link" href="#dependencies" title="Direct link to heading">#</a></h3><ul><li>使用<code>ayatana-appindicator3-0.1</code>代替<code>appindicator3-0.1</code>（在<a href="https://www.debian.org/releases/bullseye/amd64/release-notes/ch-information.en.html#noteworthy-obsolete-packages" target="_blank" rel="noopener noreferrer">Debian packages</a>中标记为过时）</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="bugfixesimprovements-4"></a>Bugfixes/improvements<a class="hash-link" href="#bugfixesimprovements-4" title="Direct link to heading">#</a></h3><ul><li>动态调用<code>SetProcessDpiAwarenessContext</code>函数以支持以前的Windows版本。</li><li>在<code>NE_RT_NATPRME</code>错误负载中显示原生方法名称。</li></ul><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="v430"></a>v4.3.0<a class="hash-link" href="#v430" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="core-auth"></a>Core: auth<a class="hash-link" href="#core-auth" title="Direct link to heading">#</a></h3><ul><li>在配置中添加了<code>tokenSecurity</code>以提高<code>NL_TOKEN</code>的安全性。接受的值有<code>none</code>和<code>one-time</code>。如果设置为<code>none</code>，Neutralinojs服务器将始终为任何应用实例公开<code>NL_TOKEN</code>，因此你可以直接从浏览器打开Neutralinojs应用。如果设置为<code>one-time</code>（推荐），Neutralinojs服务器只公开一次<code>NL_TOKEN</code>，客户端将令牌持久化在<code>sessionStorage</code>中，因此在初始客户端之后访问应用的所有其他客户端都将收到授权错误消息（通过HTML显示给用户）。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-window-2"></a>API: window<a class="hash-link" href="#api-window-2" title="Direct link to heading">#</a></h3><ul><li>添加了<code>window.setAlwaysOnTop(bool)</code>。</li><li>添加了<code>window.getSize</code>。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="core-global-variables-1"></a>Core: global variables<a class="hash-link" href="#core-global-variables-1" title="Direct link to heading">#</a></h3><ul><li>添加了<code>NL_EXTENABLED</code>，如果启用了扩展则返回<code>true</code>。它用于在初始化过程中更快地检查扩展状态。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="bugfixes"></a>Bugfixes<a class="hash-link" href="#bugfixes" title="Direct link to heading">#</a></h3><ul><li>修复了Windows上的文件对话框顺序问题。</li><li>应用退出时移除托盘图标。</li></ul><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="v420"></a>v4.2.0<a class="hash-link" href="#v420" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-clipboard"></a>API: clipboard<a class="hash-link" href="#api-clipboard" title="Direct link to heading">#</a></h3><ul><li>为所有平台添加剪贴板API。支持在系统剪贴板中读取和写入文本。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="core-configuration-1"></a>Core: configuration<a class="hash-link" href="#core-configuration-1" title="Direct link to heading">#</a></h3><ul><li>接受与Chrome相关的CLI参数：<code>--chrome-width</code>、<code>--chrome-height</code>和<code>--chrome-args</code>。</li><li>接受<code>--neu-dev-extension</code>以启用开发工具连接（用于CLI的内部使用）。</li><li>通过<code>serverHeaders</code>选项接受自定义HTTP头。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-global-variables"></a>API: global variables<a class="hash-link" href="#api-global-variables" title="Direct link to heading">#</a></h3><ul><li>添加了<code>NL_RESMODE</code>以获取有关应用资源来源的详细信息。如果资源是从<code>resources.neu</code>加载的，则返回<code>bundle</code>。否则，返回<code>directory</code>。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="bugfixes-1"></a>Bugfixes<a class="hash-link" href="#bugfixes-1" title="Direct link to heading">#</a></h3><ul><li>修复了chrome模式用户数据目录问题（支持带空格的路径）。</li><li>修复了neu CLI的浏览器模式关机问题。</li></ul><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="v410"></a>v4.1.0<a class="hash-link" href="#v410" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-window-3"></a>API: window<a class="hash-link" href="#api-window-3" title="Direct link to heading">#</a></h3><ul><li><code>window.getTitle</code>返回当前原生窗口标题。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-os-1"></a>API: os<a class="hash-link" href="#api-os-1" title="Direct link to heading">#</a></h3><ul><li>从<code>os.getEnv</code>中移除<code>NE_OS_ENVNOEX</code>，如果环境变量未定义，则返回一个空字符串。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="core-chrome-mode"></a>Core: Chrome mode<a class="hash-link" href="#core-chrome-mode" title="Direct link to heading">#</a></h3><ul><li>现在你可以通过<code>chrome</code>模式将Neutralinojs应用作为Chrome应用运行。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="core-configuration-2"></a>Core: configuration<a class="hash-link" href="#core-configuration-2" title="Direct link to heading">#</a></h3><ul><li>从<code>modes.chrome</code>中获取chrome模式配置。特别为chrome模式添加了<code>height</code>、<code>width</code>和args。</li></ul><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="v400"></a>v4.0.0<a class="hash-link" href="#v400" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-osexeccommand"></a>API: os.execCommand<a class="hash-link" href="#api-osexeccommand" title="Direct link to heading">#</a></h3><ul><li>将<code>shouldRunInBackground</code>选项重命名为<code>background</code>。</li><li>支持<code>stdIn</code>作为可选输入。</li><li>返回多个值：<code>stdOut</code>、<code>stdErr</code>、<code>pid</code>和<code>exitCode</code>。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="core-api-extensions"></a>Core: API extensions<a class="hash-link" href="#core-api-extensions" title="Direct link to heading">#</a></h3><ul><li>配置文件全局或在特定模式下支持新的<code>extensions</code>数组。</li><li>Neutralino根据<code>extensions</code>数组生成扩展进程。</li><li>Neutralino不向扩展进程发送杀死信号。扩展开发者需要正确停止进程。</li><li><code>extension</code>设置有4个字段：<code>id</code>、<code>command</code>、<code>commandLinux</code>、<code>commandDarwin</code>和<code>commandWindows</code>。</li><li><code>command</code>（平台特定命令）的值接受<code>${NL_PATH}</code>全局变量。</li><li>每个扩展进程实例都会使用三个CLI参数调用：<code>--nl-port={}</code>、<code>--nl-extension-id={}</code>和<code>--nl-token={}</code></li><li>使用<code>enableExtensions</code>配置启用/禁用扩展。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="core-static-server"></a>Core: Static server<a class="hash-link" href="#core-static-server" title="Direct link to heading">#</a></h3><ul><li>支持通过配置设置文档根目录（用<code>documentRoot</code>）。现在，可以在没有子目录的情况下启动应用。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="core-community-driver-processes"></a>Core: Community driver processes<a class="hash-link" href="#core-community-driver-processes" title="Direct link to heading">#</a></h3><p>现在开发者可以通过将Neutralinojs作为子进程生成，将Neutralinojs作为他们软件的一部分使用任何编程语言。
使用<code>exportAuthInfo</code>将认证详情写入<code>${NL_PATH}/.tmp/auth_info.json</code>。然后父进程可以在那里获取访问详情。请注意，WebSocket通信需要通过扩展API/加载器启动。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-appbroadcast"></a>API: app.broadcast<a class="hash-link" href="#api-appbroadcast" title="Direct link to heading">#</a></h3><ul><li>向所有应用客户端发送事件。此方法适用于扩展开发者。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-eventsbroadcast"></a>API: events.broadcast<a class="hash-link" href="#api-eventsbroadcast" title="Direct link to heading">#</a></h3><ul><li>向所有客户端（应用和扩展）发送事件。用于通知重要的一般事件。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-extensions"></a>API: extensions<a class="hash-link" href="#api-extensions" title="Direct link to heading">#</a></h3><ul><li><code>dispatch</code>：向特定扩展发送事件。</li><li><code>broadcast</code>：向所有连接的扩展发送事件。用于发送关闭信号。</li><li><code>getStats</code>：返回有关加载的扩展和连接的扩展的详细信息。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="api-updater"></a>API: updater<a class="hash-link" href="#api-updater" title="Direct link to heading">#</a></h3><ul><li><code>checkForUpdates</code>：向种子URL（JSON）发送请求并获取更新详情。</li><li><code>install</code>：根据当前下载的清单安装更新。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="events-1"></a>Events<a class="hash-link" href="#events-1" title="Direct link to heading">#</a></h3><ul><li><code>appClientConnect</code>和<code>appClientDisconnect</code>：分别在新的应用实例启动和关闭时发生。</li><li><code>extClientConnect</code>和<code>extClientDisconnect</code>：分别在新扩展连接和断开连接时发生。</li><li><code>extensionReady</code>可用于实现立即扩展调用。这是从客户端使用<code>extensions.getStats</code>和<code>extClientConnect</code>实现的。这个事件保证无论扩展启动时间如何都会触发。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="error-codes"></a>Error codes<a class="hash-link" href="#error-codes" title="Direct link to heading">#</a></h3><ul><li><code>NE_EX_EXTNOTC</code>：如果目标扩展未连接，由<code>extensions.dispatch</code>抛出。</li><li><code>NE_UP_CUPDMER</code>：如果JSON更新清单无效或applicationId不匹配，由<code>updater.checkForUpdates</code>抛出。</li><li><code>NE_UP_CUPDERR</code>：如果更新器API无法获取清单，由<code>updater.checkForUpdates</code>抛出。</li><li><code>NE_UP_UPDNOUF</code>：当更新清单未加载时，由<code>updater.install</code>抛出。</li><li><code>NE_UP_UPDINER</code>：对于更新安装错误，由<code>updater.install</code>抛出。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="bug-fixes"></a>Bug fixes<a class="hash-link" href="#bug-fixes" title="Direct link to heading">#</a></h3><ul><li>修复了模式中的端口0问题。之前，如果开发者从特定模式设置端口为0，<code>NL_PORT</code>也会变为0。</li><li>修复了<code>writeToLogFile</code>配置选项的问题。之前，即使此选项设置为<code>false</code>，也会创建日志文件。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="global-variables-1"></a>Global variables<a class="hash-link" href="#global-variables-1" title="Direct link to heading">#</a></h3><ul><li><code>NL_APPVERSION</code>：配置文件中<code>version</code>键的值。</li></ul></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/neutralinojs/neutralinojs.github.io/edit/main/docs/release-notes/framework.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" role="img" viewBox="0 0 40 40" class="iconEdit_2_ui" aria-label="Edit page"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav" aria-label="Docs pages navigation"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/zh-cn.neutralinojs.github.io/docs/contributing/about-neutralinojs"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« 关于 Neutralinojs</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/zh-cn.neutralinojs.github.io/docs/release-notes/cli"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">命令行 »</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_1nbE thin-scrollbar"><div><div data-ea-publisher="neutralino" data-ea-type="image" id="neutralino-docs"></div></div><ul class="table-of-contents table-of-contents__left-border"><li><a href="#unreleased" class="table-of-contents__link">Unreleased</a></li><li><a href="#v500" class="table-of-contents__link">v5.0.0</a><ul><li><a href="#api-reading-writing-with-standard-streams" class="table-of-contents__link">API: Reading, writing with standard streams</a></li><li><a href="#api-filesystem" class="table-of-contents__link">API: filesystem</a></li><li><a href="#api-os" class="table-of-contents__link">API: os</a></li><li><a href="#core-security" class="table-of-contents__link">Core: security</a></li><li><a href="#global-variables" class="table-of-contents__link">Global variables</a></li><li><a href="#deprecations" class="table-of-contents__link">Deprecations</a></li></ul></li><li><a href="#v4150" class="table-of-contents__link">v4.15.0</a><ul><li><a href="#configuration-custom-user-agent-string" class="table-of-contents__link">Configuration: custom user agent string</a></li><li><a href="#configuration-custom-configuration-files" class="table-of-contents__link">Configuration: custom configuration files</a></li></ul></li><li><a href="#v4141" class="table-of-contents__link">v4.14.1</a><ul><li><a href="#devops" class="table-of-contents__link">DevOps</a></li></ul></li><li><a href="#v4140" class="table-of-contents__link">v4.14.0</a><ul><li><a href="#filesystem-api" class="table-of-contents__link">Filesystem API</a></li><li><a href="#os-api" class="table-of-contents__link">OS API</a></li><li><a href="#improvementsbugfixes" class="table-of-contents__link">Improvements/bugfixes</a></li><li><a href="#devops-1" class="table-of-contents__link">DevOps</a></li></ul></li><li><a href="#v4130" class="table-of-contents__link">v4.13.0</a><ul><li><a href="#core-persistent-window-state" class="table-of-contents__link">Core: persistent window state</a></li><li><a href="#improvementsbugfixes-1" class="table-of-contents__link">Improvements/bugfixes</a></li></ul></li><li><a href="#v4120" class="table-of-contents__link">v4.12.0</a><ul><li><a href="#api-window" class="table-of-contents__link">API: window</a></li><li><a href="#core-configuration" class="table-of-contents__link">Core: configuration</a></li><li><a href="#core-webview" class="table-of-contents__link">Core: webview</a></li><li><a href="#improvementsbugfixes-2" class="table-of-contents__link">Improvements/bugfixes</a></li></ul></li><li><a href="#v4110" class="table-of-contents__link">v4.11.0</a><ul><li><a href="#api-file-watchers" class="table-of-contents__link">API: File watchers</a></li><li><a href="#improvementsbugfixes-3" class="table-of-contents__link">Improvements/bugfixes</a></li></ul></li><li><a href="#v4100" class="table-of-contents__link">v4.10.0</a><ul><li><a href="#devops-2" class="table-of-contents__link">DevOps</a></li><li><a href="#improvementsbugfixes-4" class="table-of-contents__link">Improvements/bugfixes</a></li><li><a href="#esmnpm-support" class="table-of-contents__link">ESM/NPM support</a></li></ul></li><li><a href="#v490" class="table-of-contents__link">v4.9.0</a><ul><li><a href="#api-custom-methods" class="table-of-contents__link">API: Custom methods</a></li><li><a href="#api-file-streams" class="table-of-contents__link">API: File streams</a></li></ul></li><li><a href="#v480" class="table-of-contents__link">v4.8.0</a><ul><li><a href="#api-osgetenvs" class="table-of-contents__link">API: os.getEnvs</a></li><li><a href="#api-filesystem-1" class="table-of-contents__link">API: filesystem</a></li><li><a href="#api-storagegetkeys" class="table-of-contents__link">API: storage.getKeys</a></li><li><a href="#api-computergetmouseposition" class="table-of-contents__link">API: computer.getMousePosition</a></li><li><a href="#bugfixesimprovements" class="table-of-contents__link">Bugfixes/improvements</a></li></ul></li><li><a href="#v470" class="table-of-contents__link">v4.7.0</a><ul><li><a href="#api-system-information-api" class="table-of-contents__link">API: System information API</a></li><li><a href="#api-os-dialogs" class="table-of-contents__link">API: os dialogs</a></li><li><a href="#devops-3" class="table-of-contents__link">DevOps</a></li><li><a href="#bugfixesimprovements-1" class="table-of-contents__link">Bugfixes/improvements</a></li></ul></li><li><a href="#v460" class="table-of-contents__link">v4.6.0</a><ul><li><a href="#api-process-spawning-api" class="table-of-contents__link">API: Process spawning API</a></li><li><a href="#core-events" class="table-of-contents__link">Core: events</a></li><li><a href="#devops-4" class="table-of-contents__link">DevOps</a></li><li><a href="#api-filesystem-2" class="table-of-contents__link">API: filesystem</a></li><li><a href="#bugfixesimprovements-2" class="table-of-contents__link">Bugfixes/improvements</a></li></ul></li><li><a href="#v450" class="table-of-contents__link">v4.5.0</a><ul><li><a href="#core-events-1" class="table-of-contents__link">Core: events</a></li><li><a href="#devops-5" class="table-of-contents__link">DevOps</a></li><li><a href="#bugfixesimprovements-3" class="table-of-contents__link">Bugfixes/improvements</a></li><li><a href="#core-global-variables" class="table-of-contents__link">Core: global variables</a></li></ul></li><li><a href="#v440" class="table-of-contents__link">v4.4.0</a><ul><li><a href="#api-window-1" class="table-of-contents__link">API: window</a></li><li><a href="#api-filesystem-3" class="table-of-contents__link">API: filesystem</a></li><li><a href="#dependencies" class="table-of-contents__link">Dependencies</a></li><li><a href="#bugfixesimprovements-4" class="table-of-contents__link">Bugfixes/improvements</a></li></ul></li><li><a href="#v430" class="table-of-contents__link">v4.3.0</a><ul><li><a href="#core-auth" class="table-of-contents__link">Core: auth</a></li><li><a href="#api-window-2" class="table-of-contents__link">API: window</a></li><li><a href="#core-global-variables-1" class="table-of-contents__link">Core: global variables</a></li><li><a href="#bugfixes" class="table-of-contents__link">Bugfixes</a></li></ul></li><li><a href="#v420" class="table-of-contents__link">v4.2.0</a><ul><li><a href="#api-clipboard" class="table-of-contents__link">API: clipboard</a></li><li><a href="#core-configuration-1" class="table-of-contents__link">Core: configuration</a></li><li><a href="#api-global-variables" class="table-of-contents__link">API: global variables</a></li><li><a href="#bugfixes-1" class="table-of-contents__link">Bugfixes</a></li></ul></li><li><a href="#v410" class="table-of-contents__link">v4.1.0</a><ul><li><a href="#api-window-3" class="table-of-contents__link">API: window</a></li><li><a href="#api-os-1" class="table-of-contents__link">API: os</a></li><li><a href="#core-chrome-mode" class="table-of-contents__link">Core: Chrome mode</a></li><li><a href="#core-configuration-2" class="table-of-contents__link">Core: configuration</a></li></ul></li><li><a href="#v400" class="table-of-contents__link">v4.0.0</a><ul><li><a href="#api-osexeccommand" class="table-of-contents__link">API: os.execCommand</a></li><li><a href="#core-api-extensions" class="table-of-contents__link">Core: API extensions</a></li><li><a href="#core-static-server" class="table-of-contents__link">Core: Static server</a></li><li><a href="#core-community-driver-processes" class="table-of-contents__link">Core: Community driver processes</a></li><li><a href="#api-appbroadcast" class="table-of-contents__link">API: app.broadcast</a></li><li><a href="#api-eventsbroadcast" class="table-of-contents__link">API: events.broadcast</a></li><li><a href="#api-extensions" class="table-of-contents__link">API: extensions</a></li><li><a href="#api-updater" class="table-of-contents__link">API: updater</a></li><li><a href="#events-1" class="table-of-contents__link">Events</a></li><li><a href="#error-codes" class="table-of-contents__link">Error codes</a></li><li><a href="#bug-fixes" class="table-of-contents__link">Bug fixes</a></li><li><a href="#global-variables-1" class="table-of-contents__link">Global variables</a></li></ul></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="row footer__links"><div class="col footer__col"><h4 class="footer__title">文档</h4><ul class="footer__items"><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/docs/">入门</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/docs/api/overview">API参考</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/docs/cli/neu-cli">CLI</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/docs/configuration/modes">模式</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/docs/contributing/framework-developer-guide">贡献</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">社区</h4><ul class="footer__items"><li class="footer__item"><a href="https://github.com/neutralinojs" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub</a></li><li class="footer__item"><a href="https://twitter.com/neutralinojs" target="_blank" rel="noopener noreferrer" class="footer__link-item">Twitter</a></li><li class="footer__item"><a href="https://stackoverflow.com/questions/tagged/neutralinojs" target="_blank" rel="noopener noreferrer" class="footer__link-item">Stack Overflow</a></li><li class="footer__item"><a href="https://medium.com/neutralinojs" target="_blank" rel="noopener noreferrer" class="footer__link-item">Medium</a></li><li class="footer__item"><a href="https://www.youtube.com/watch?v=txDlNNsgSh8&amp;list=PLvTbqpiPhQRb2xNQlwMs0uVV0IN8N-pKj&amp;ab_channel=CodeZri" target="_blank" rel="noopener noreferrer" class="footer__link-item">YouTube</a></li><li class="footer__item"><a href="https://join.slack.com/t/neutralinojs/shared_invite/zt-b7mbivj5-pKpO6U5drmeT68vKD_pc6w" target="_blank" rel="noopener noreferrer" class="footer__link-item">Slack</a></li><li class="footer__item"><a href="https://discord.gg/cybpp4guTJ" target="_blank" rel="noopener noreferrer" class="footer__link-item">Discord</a></li><li class="footer__item"><a href="https://www.reddit.com/r/neutralinojs/" target="_blank" rel="noopener noreferrer" class="footer__link-item">Reddit</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">更多</h4><ul class="footer__items"><li class="footer__item"><a href="https://github.com/neutralinojs/neutralinojs" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub</a></li><li class="footer__item"><a href="https://www.patreon.com/shalithasuranga" target="_blank" rel="noopener noreferrer" class="footer__link-item">Patreon</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/privacy-policy">隐私政策</a></li><li class="footer__item"><a href="https://codezri.org/blog/" target="_blank" rel="noopener noreferrer" class="footer__link-item">博客</a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2024 Neutralinojs | innovation by <a href="https://codezri.org/">CodeZri.org</a></div></div></div></footer></div>
<script src="/zh-cn.neutralinojs.github.io/assets/js/styles.c25d7c9f.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/runtime~main.da1bdab8.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/main.22927eab.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/1.a80d899d.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/2.818fc9a7.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/49.8e895b96.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/50.816652b0.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/935f2afb.a67ede05.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/17896441.74f92a0c.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/0f9c640a.de22ead4.js"></script>
</body>
</html>